package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.db.domain.system.MpClientSubOrder;
import com.ruoyi.db.mapper.system.MpClientSubOrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.service.IMpClientSubOrderService;

import javax.transaction.Transactional;

/**
 * 子订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-08-01
 */
@Service
@Transactional(rollbackOn = Exception.class)
public class MpClientSubOrderServiceImpl implements IMpClientSubOrderService 
{
    @Autowired
    private MpClientSubOrderMapper mpClientSubOrderMapper;

    /**
     * 查询子订单
     * 
     * @param subOrderId 子订单主键
     * @return 子订单
     */
    @Override
    public MpClientSubOrder selectMpClientSubOrderBySubOrderId(String subOrderId)
    {
        return mpClientSubOrderMapper.selectMpClientSubOrderBySubOrderId(subOrderId);
    }

    /**
     * 查询子订单列表
     * 
     * @param mpClientSubOrder 子订单
     * @return 子订单
     */
    @Override
    public List<MpClientSubOrder> selectMpClientSubOrderList(MpClientSubOrder mpClientSubOrder)
    {
        return mpClientSubOrderMapper.selectMpClientSubOrderList(mpClientSubOrder);
    }

    /**
     * 新增子订单
     * 
     * @param mpClientSubOrder 子订单
     * @return 结果
     */
    @Override
    public int insertMpClientSubOrder(MpClientSubOrder mpClientSubOrder)
    {
        mpClientSubOrder.setCreateTime(DateUtils.getNowDate());
        return mpClientSubOrderMapper.insertMpClientSubOrder(mpClientSubOrder);
    }

    /**
     * 修改子订单
     * 
     * @param mpClientSubOrder 子订单
     * @return 结果
     */
    @Override
    public int updateMpClientSubOrder(MpClientSubOrder mpClientSubOrder)
    {
        return mpClientSubOrderMapper.updateMpClientSubOrder(mpClientSubOrder);
    }

    /**
     * 批量删除子订单
     * 
     * @param subOrderIds 需要删除的子订单主键
     * @return 结果
     */
    @Override
    public int deleteMpClientSubOrderBySubOrderIds(String[] subOrderIds)
    {
        return mpClientSubOrderMapper.deleteMpClientSubOrderBySubOrderIds(subOrderIds);
    }

    /**
     * 删除子订单信息
     * 
     * @param subOrderId 子订单主键
     * @return 结果
     */
    @Override
    public int deleteMpClientSubOrderBySubOrderId(String subOrderId)
    {
        return mpClientSubOrderMapper.deleteMpClientSubOrderBySubOrderId(subOrderId);
    }
}
